export default {
	namespaced: true,
	
	state:{
		token: uni.getStorageSync("token") || null,                      // token
		role: uni.getStorageSync("role") || null,                      // 是否入驻
		sid: uni.getStorageSync("sid") || null,                      // sid
		tokenTime: uni.getStorageSync("tokenTime") || null,              // token时间戳
		isBindMobile: uni.getStorageSync("isBindMobile") || null,        // 用户是否绑定手机号
		userMobile: uni.getStorageSync("userMobile") || null,            // 用户手机号
		userId: uni.getStorageSync("userId") || null,                    // 用户id
		enterStatus: uni.getStorageSync("enter_enterStatus") || null,    // 入驻状态  null：未申请入驻  0：申请入驻中  1：入驻申请通过  2：入驻申请不通过
		enterRole: uni.getStorageSync("enter_enterRole") || null,        // 入驻角色  null: 还未入驻  designer：设计师  shop：品牌商  builder：施工方  guide：导购
		enterMobile: uni.getStorageSync("enter_enterMobile") || null,    // 入驻手机号
		isAnewApply: false,    // 是否重新申请
		isAnewSubmit: false,   // 是否重新提交数据
		page:uni.getStorageSync("page") || null, //权限路径
		qyUserId:uni.getStorageSync("qyUserId") || null, //权限路径
		identityType:uni.getStorageSync('identityType') || null,//身份类型
		isMaster:uni.getStorageSync('isMaster') || null,//是否创业主
		storeCount:uni.getStorageSync('storeCount') || null,//是否创业主
		marketId:uni.getStorageSync('marketId') || null, //卖场id
		
		moduleType:uni.getStorageSync('moduleType') || null, //超级管理员类型 1-超级管家，2-超级政委，3-精英管家
		moduleTeamId:uni.getStorageSync('moduleTeamId') || null, // 超级管家团队id
		
	},
	
	mutations: {
		// 设置-token
		["SET_token"] (state, payload) { 
			state.token = payload
			uni.setStorageSync("token", payload) 
		},
		// 设置-角色入驻
		["SET_role"] (state, payload) { 
			state.role = payload
			uni.setStorageSync("role", payload) 
		},
		// 设置-角色入驻
		["SET_sid"] (state, payload) { 
			state.sid = payload
			uni.setStorageSync("sid", payload) 
		},
		// 设置-token时间戳
		["SET_tokenTime"] (state, payload) { 
			state.tokenTime = payload
			uni.setStorageSync("tokenTime", payload) 
		},
		// 设置-用户是否绑定手机号
		["SET_isBindMobile"] (state, payload) { 
			state.isBindMobile = payload
			uni.setStorageSync("isBindMobile", payload) 
		},
		// 设置-用户手机号
		["SET_userMobile"] (state, payload) { 
			state.userMobile = payload
			uni.setStorageSync("userMobile", payload)
		},
		// 设置-用户id
		["SET_userId"] (state, payload) { 
			state.userId = payload
			uni.setStorageSync("userId", payload)
		},
		// 设置-入驻状态
		["SET_enterStatus"] (state, payload) { 
			state.enterStatus = payload
			uni.setStorageSync("enter_enterStatus", payload)
		},
		// 设置-入驻角色
		["SET_enterRole"] (state, payload) { 
			state.enterRole = payload
			uni.setStorageSync("enter_enterRole", payload)
		},
		// 设置-入驻手机号
		["SET_enterMobile"] (state, payload) { 
			state.enterMobile = payload
			uni.setStorageSync("enter_enterMobile", payload)
		},
		// 设置-是否重新申请
		["SET_isAnewApply"] (state, payload) { 
			state.isAnewApply = payload
		},
		// 设置-是否重新提交数据
		["SET_isAnewSubmit"] (state, payload) { 
			state.isAnewSubmit = payload
		},
		// 设置-权限路径
		["SET_page"] (state, payload) { 
			state.page = payload
			uni.setStorageSync("page", payload) 
		},
		// 设置-企业微信qy_user_id
		["SET_qyUserId"] (state, payload) { 
			state.qyUserId = payload
			uni.setStorageSync("qyUserId", payload) 
		},
		// 设置-身份类型
		["SET_identityType"] (state, payload) { 
			state.identityType = payload
			uni.setStorageSync("identityType", payload) 
		},
		// 设置-创客身份
		["SET_isMaster"] (state, payload) { 
			state.isMaster = payload
			uni.setStorageSync("isMaster", payload) 
		},
		// 设置-多店铺数量
		["SET_storeCount"] (state, payload) { 
			state.storeCount = payload
			uni.setStorageSync("storeCount", payload) 
		},
		// 设置-多店铺数量
		["SET_marketId"] (state, payload) { 
			state.marketId = payload
			uni.setStorageSync("marketId", payload) 
		},
		// 设置-超级管家类型
		["SET_moduleType"] (state, payload) { 
			state.moduleType = payload
			uni.setStorageSync("moduleType", payload) 
		},
		// 设置-超级管家团队id
		["SET_moduleTeamId"] (state, payload) { 
			state.moduleTeamId = payload
			uni.setStorageSync("moduleTeamId", payload) 
		},
	}
}